Socket
Socket
Sign inDemoInstall

hast-util-heading-rank

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hast-util-heading-rank

hast utility to get the rank (or depth, level) of headings


Version published
Weekly downloads
2.7M
decreased by-1.61%
Maintainers
2
Weekly downloads
 
Created
Source

hast-util-heading-rank

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to get the rank (or depth, level) of headings.

Install

npm:

npm install hast-util-heading-rank

Use

var h = require('hastscript')
var rank = require('hast-util-heading-rank')

rank(h('p', 'Alpha')) //=> null
rank(h('h5', 'Alpha')) //=> 5

API

headingRank(node)

Get the rank (1 to 6) of headings (h1 to h6).

Parameters
  • node (Node) — Node to check
Returns

rank (number?) — Rank of the heading, or null if not a heading.

Security

hast-util-heading-rank does not mutate. There are no openings for cross-site scripting (XSS) attacks.

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 04 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc